import request from '@/config/axios'

// 我的收藏 VO
export interface JobCollectionVO {
  id: number // 主键id
  userId: number // 用户id
  jobId: number // 职位id
}

// 我的收藏 API
export const JobCollectionApi = {
  // 查询我的收藏分页
  getJobCollectionPage: async (params: any) => {
    return await request.get({ url: `/member/job-collection/page`, params })
  },

  // 查询我的收藏详情
  getJobCollection: async (id: number) => {
    return await request.get({ url: `/member/job-collection/get?id=` + id })
  },

  // 新增我的收藏
  createJobCollection: async (data: JobCollectionVO) => {
    return await request.post({ url: `/member/job-collection/create`, data })
  },

  // 修改我的收藏
  updateJobCollection: async (data: JobCollectionVO) => {
    return await request.put({ url: `/member/job-collection/update`, data })
  },

  // 删除我的收藏
  deleteJobCollection: async (id: number) => {
    return await request.delete({ url: `/member/job-collection/delete?id=` + id })
  },

  // 导出我的收藏 Excel
  exportJobCollection: async (params) => {
    return await request.download({ url: `/member/job-collection/export-excel`, params })
  }
}